package com.zt.chatgpt.openai.model.aggregates;

import com.zt.chatgpt.openai.model.valobj.UserAccountStatusVO;
import com.zt.chatgpt.types.common.Constants;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.List;

/**
 * @author: zt
 * @Description: 用户账户实体对象
 * @create: 2024-05-22 17:52
 */

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserAccountQuotaEntity {

    /**
     * 用户ID
     */
    private String openid;
    /**
     * 用户总额
     */
    private Integer totalQuota;
    /**
     * 剩余额度
     */
    private Integer surplusQuota;
    /**
     * 账户状态
     */
    private UserAccountStatusVO userAccountStatusVO;
    /**
     * 用户可用模型列表
     */
    private List<String> allowModelTypes;

    public void genAllowModelTypes(String modelTypes) {
        String[] modelTypeArray = modelTypes.split(Constants.SPLIT);
        this.allowModelTypes = Arrays.asList(modelTypeArray);
    }
}
